/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.restorator.dao.implement;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import org.restorator.dao.base.UserDao;
import org.restorator.dao.implement.engin.RoleRowMapper;
import org.restorator.dao.implement.engin.UserRowMapper;
import org.restorator.dao.jdbc.AbstractJdbsTemplate;
import org.restorator.dao.jdbc.Enricher;
import org.restorator.dao.jdbc.PreparedSetter;
import org.restorator.dao.jdbc.SimpleResultSetExtractor;
import org.restorator.entity.Roles;
import org.restorator.entity.User;
import org.restorator.exception.DataStoreException;

/**
 *
 * @author Administrator
 */
public class RolesDaoImpl extends AbstractJdbsTemplate<Roles, Integer>{

    private static final String SQL_SELECT_ROLE_BY_ID = "SELECT r.ROLE_ID, r.ROLE FROM ROLES r WHERE ROLE_ID = ?";
    
    @Override
    public Roles get(final Integer id) throws DataStoreException {
    	return executeParameter(SQL_SELECT_ROLE_BY_ID,
                new SimpleResultSetExtractor(new RoleRowMapper()), Enricher.NULL,
                new PreparedSetter() {
                @Override
                public void setParameters(PreparedStatement ps) throws SQLException {
                ps.setInt(1, id);
            }
        }); 
    }

    @Override
    public void delete(Roles deleted) throws DataStoreException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

     @Override
    public Integer save(Roles persist, Object... addParams) throws DataStoreException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }    

    @Override
    public Roles update(Roles persistElement) throws DataStoreException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public long count() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public List<Roles> getAll() throws DataStoreException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public boolean exist(Integer id) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
